package concurrent.mycondition.CSmodel;

import concurrent.mycondition.CSmodel.Consumer;
import concurrent.mycondition.CSmodel.MiddlewareChannel;
import concurrent.mycondition.CSmodel.Producer;

public class ClientTest {

    public static void main(String[] args) {
        //创建消息通道
        MiddlewareChannel middlewareChannel = new MiddlewareChannel();

        //创建消息消费者
        Consumer conumer1 = new Consumer(middlewareChannel);


//		//创建消息消费者
//		Conumer conumer2 = new Conumer(middlewareChannel);
//		new Thread(conumer2, "消费者2").start();

        //创建消息生产者1
        Producer producer1 = new Producer(middlewareChannel);
        // 处理器性能好，内存容量大，导致先启动哪个，哪个就会获得锁
        new Thread(producer1,"生产者1").start();
        new Thread(conumer1,"消费者1").start();

//		//创建消息生产者2
//		Producer producer2 = new Producer(middlewareChannel, "我爱加班");
//		new Thread(producer2,"生产者2").start();


    }

}